home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Workbench Add-On
/
Workbench Add-On - Volume 1.iso
/
Music
/
MIDI
/
mod2midi
/
Mod2Midi.doc
< prev
next >
Wrap
Text File
|
1995-08-23
|
15KB
|
377 lines
Mod2Midi V1.0 Amiga conversion © 1994 by Paul Huxham
MIDIMOD - Amiga Noise/Sound/Protracker to MIDI file converter (ver 0.2)
© Andrew Scott 1993
Conversion Authors Notes
========================
Mod2Midi is based on MIDIMOD by Andrew Scott.
These instructions are based on the original program documentation by
Andrew Scott.
The license for the use of this software is contained in the archive
midimod2.zip.
The file midimod2.zip is the original PC archive of the source code.
If you modify the Amiga conversion - Mod2Midi, please follow the
instructions in Andrew Scotts' license about naming conventions and source
code distribution so that others don't have a hard time working which out
version is what.
The included Amiga source code compiles under SAS/C 6.51.
Mod2Midi - What it does
======================
Mod2Midi is a program which converts music modules generated by Amiga
tracker programs (MOD files) to general MIDI format 1 (MID files). Some
editing of the output MID file might be necessary, but next time there
will be less editing to do as Mod2Midi can remember previous settings.
Why convert MOD files to MID files?
===================================
Even though MOD files contain some music-instructions that cannot be
represented in MID format, there are many reasons why it is desirable to
have music in MID form rather than MOD form:
* Top-of-the-range music editing programs do not handle MOD files, but
almost always handle MID files, or at least allow you to convert from MID
files.
* There exist programs to print out MID files as musical score. I don't
know of any which do the same for MOD files
* MID files tend to be much smaller than MOD files
* MID files are more portable, having a well-known format, and have
utilities on many different computers. MID files _ARE_ the industry
standard.
* MID files can be played on professional keyboards, allowing expert
recording/presentation of music
How to use Mod2Midi
===================
Mod2Midi is a CLI/Shell based program, designed to be run from a shell
operating on the WorkBench screen. All parameters are supplied on the
command line when launching Mod2Midi.
Explanation of Parameters
=========================
The command template for Mod2Midi is:
MOD,MIDI,ABOUT/S,MAPSAMPLES/S,SAVEINFO/S,
TRANSPOSE/S,DRUM/N,TEMPO/N,VOLUMESHIFT/S
ABOUT
-----
Displays the copyright information.
MOD
---
The name of the source MOD file.
MIDI
----
The name of the target MIDI format 1 file. Files that exist will be
overwritten - BEWARE.
MAPSAMPLES
----------
There are many, many MOD samples on computers around the world, so it is
impossible to automatically know which instrument is equivalent to which
sample. You must tell Mod2Midi which instrument to use. Use the mouse to
select a sample from the list that appears on the screen.
Each sample may have an asterisk "*" before it - this means that there is
actual sample data that corresponds to this sample - ignore any other
samples...they won't be converted (except in name only). Each sample will
have an instrument code to its right. If the code is prefixed by a "D"
then it is a percussion code.
After selecting a sample, a list of all of the available instruments will
appear on the screen. Select one and the appropriate code will appear to
the right of the chosen sample. Samples that already have an instrument
code should be left alone as they already have been matched with a sample's
name.
SAVEINFO
--------
Because it is nicer to have the computer select instruments, transpositions
and volume shifts for you than having to look them up each time, Mod2Midi
keeps a list of "known" mappings/transposes/volume-shifts from MOD-samples
to MIDI instruments.
Once you have selected a mapping using the MAPSAMPLES, a transposition
using TRANSPOSE, or a volume shift using VOLUMESHIFT you can use this
command to save a sample's info to the info file.
TRANSPOSE
---------
Even if you have matched a MOD sample with a MIDI instrument there is no
guarantee that each will play at the same pitch. MOD samples tend to sound
high, low, very low, or slightly off pitch when both MOD and MIDI
instruments play the same note. The trick is to map MOD samples to a
different note during the conversion, so that there won't be any horrible
musical clashes.
A good way to do this is to find a sample that maps exactly to a MIDI
instrument, and then get a MOD-editor and play other samples, and compare
those samples to the "true" sample. This way you can find the number of
semitones difference there are between a MOD sample and its instrument
equivalent.
For example, bass guitar samples are usually an octave lower (sometimes
two) than their actual note. As an octave is 12 semitones, if the guitar
sample is transposed down 12 semitones, it sounds ok. Another example,
chords are usually made up of 3 notes which are played simulateously (major
chords have part of them transposed up 4 semitones, and another part 7
semitones where minor chords have 3 and 7 semitone transposed parts).
After selecting a MOD-sample from the menu (the numbers on the right are
the transpose values), you can enter in its transposition. For a bass
sample you might enter:
-12
then press <RETURN>, whereas for a major chord you might enter
0, 4, 7
then press <RETURN>, and for a bass major chord you might enter
-12, -8, -5
then press <RETURN> (note than -12+4=-8 etc.).
During conversion, these transpositions are applied and hopefully the
MID-file won't sound as if many musicians are playing using different
scales.
A couple of things you need to watch out for: if one of the transposition
values is 0 then it must be the first value, also don't transpose
percussion instruments - it's not a good idea.
DRUM
----
As different software/hardware is by definition different, you can use this
option to set the drum channel. The default drum channel is 10.
TEMPO
-----
Some MOD-files use an old tempo convention and don't convert at all well if
the wrong convention is used. The default TEMPO value is 0 for NORMAL.
If the MID file produced sounds like the timing is out of whack, try
setting TEMPO to 1 for EXTENDED and do the conversion again.
VOLUMESHIFT
-----------
This is similar to transposing, but it affects volume rather than pitch.
Mod2Midi alters volumes by applying a formula to each volume in the MOD
file.
The formula is simple: it takes the volume, then adds a number, then
multiplies by a number, then divides by a number. So all you have to do is
supply 3 numbers, though when you come to change a volume formula you will
notice that Mod2Midi has already given each sample a formula.
Mod2Midi analyses each sample of the MOD file when you it reads in the MOD
file and based on this analysis allocates a formula to the samples. Note
that these formulae are not necessarily correct, they are just Mod2Midi's
best guess, but most of the time they will suffice. To set the formula
yourself, choose a sample then enter the three numbers for the formula
respectively (as you do for transposition amounts), eg. if you want to
"add 1, multiply by 2, then divide by 3" every volume for a particular
sample, you would enter:
1, 2, 3
then press <RETURN>. The last two numbers cannot be negative, and the last
number cannot be 0.
Converting MODs
===============
Use the MAPSAMPLES option to set samples to appropriate instruments. If
you get an error message which says that you have too many different
instruments, then use the MAPSAMPLES option to reduce the number.
The Instruments
===============
A list of MIDI instruments is kept in the file "Mod2Midi.ins". Each
instrument on a separate line. The first 128 lines must hold the
instruments 0 to 127. The lines after this hold the percussion instruments
(no more than 128). All instruments should have a code as the first thing
on the line. The code must consist of the letter "D" (if it is a
percussion instrument) followed by a number from 0 to 127.
This file can be edited with a text editor to put in the instruments for
your particular computer/keyboard/software etc. The supplied instrument
file contains the Soundblaster MIDI patches, if you are using a synth or a
different sound card, then edit this file and insert the correct
instruments.
The Info File
=============
A list of default mappings and transpositions is kept in the text file
"Mod2Midi.map". This is maintained with the SAVEINFO option, but it can
also be edited with a text-editor.
Each sample is on a separate line, and consists of the first word in the
sample's name followed by 7 numbers, all separated by spaces. The first
word is the sample's name (which comes right after any header (st-xx: or
leading spaces) and has any intermediate spaces replaced by underline
characters. The first number is a mapping number, the next three numbers
are transposition values (normally 0 0 0), and the last three are the
volume-shift values (eg. 1 0 0).
The mapping numbers range from 0 to 255. The numbers 0-127 correspond to
the MIDI instruments 0-127, and the other mapping numbers are the
percussion instrument codes plus 128 (without the "D" in front).
The transposition values hold either a set amount to transpose the
instrument by (first transposition value) or a mapping to a chord (two or
more non-zero numbers). Any 0 transposition value must occur in the first
position. The transposition values range -128 to 127, 0 to 127, and 1 to
127 respectively in the formula (volume + x) * y / z.
Each line in the info file is in alphabetical order, and it would be a bad
idea to put a sample in the wrong place.
All of the mapping/transpositions in the supplied "Mod2Midi.map" file are
for the Soundblaster card.
What is this .mm file?
======================
Because there are some times when you don't want to store information about
a MOD file in the info file, a file with the same name as the MOD- file
except with a .mm extension is created.
This .mm file holds all of the information that you have entered about the
MOD-file. It is automatically read in when you load the MOD file, and
automatically saved when you quit. It is read in just before checking the
info file (above), and so if you have added any new sample info that
applies to that particular MOD-file it will be included.
You can safely delete the .mm file, but it will come back next time you
using that MOD-file.
Notes on Conversion
===================
Firstly, the way the algorithm works, each different instrument is
allocated a different channel (this makes later editing of the MID file
much easier). As there are only 16 different channels this causes a bit of
a problem when you have a MOD file with 31 different samples.
All is not lost due to the nature of MOD files. Each percussion instrument
can be put on the same channel (10), giving you unlimited percussion
instruments but 15 channels for the other instruments. If the MOD file you
are using has more than 15 completely different non-percussion samples then
it is an unusual MOD file indeed, and you will need to give some of the
non-percussion samples the same instrument.
There is also some ambiguity with regard to multiple notes of the same
pitch on the same channel in the MIDI format. The MOD format can handle it
if the notes are on different channels, but if they are the same sample
then Mod2Midi will map them to the same channel in MIDI format. Some MIDI
players allow "overlapping" notes, some don't - I was going to
automatically remove "overlapped" notes, but no MIDI-player that I have
look at chucks a fit if they are in, so they are still there.
It seems that there is also ambiguity with the MOD format, and tempo can be
interpreted two ways. If your MID file sounds like it should be in a
different tempo in places, try using the TEMPO to set the type to 1 -
EXTENDED.
Even with automatic volume-shift allocation and checking of the info- file
for previous samples you will occasionally meet a converted MID file that
doesn't sound right.Also, some samples may not be recognised by Mod2Midi
and may need transposing otherwise the tune might sound horrible. As soon
as you find correct details about any new sample, feed them back into
Mod2Midi so it can recognise them correctly next time.
Not all MOD effects can be reproduced in a MID file. Things that are
reproduced include:
* Tempo (given that your MID player can handle a tempo-track)
* Note length (calculated from frequency, tempo, and # bytes in sample)
* Pattern Break
* Position Jump (pretend its a Pattern Break)
* Set Volume
* Note slides (slide up, slide down, slide to, fine-up, fine-down)
all implemented, but permanently in glissando mode (ie. not a
smooth slide).
* Arpeggio
* Volume Slides (and finevolume slides), but only if they occur at
the start of a note
* Set Sample Offset (actually retriggers the sample)
* Retrigger sample
* Cut sample
* Delay sample
* Pattern delay
Effects that are not reproducable, or have been ignored on the grounds that
they are silly in a MID file are:
* Vibrato and Tremolo (not really possible to do nicely in a MID file)
* Position Jump (sort of)
* Pattern Loop (can cause infinite loops. MIDI doesn't support loops)
* Set filter (an Amiga only hardware effect)
* Set glissando (permanently on)
* Set vibrato/tremolo waveforms (no MIDI equivalent)
* Invert loop
Source Code
===========
The source code is contained in this archive. If you give Mod2Midi to
anyone else or upload it anywhere or whatever, then you must give them the
source code too!
It must always be possible for the user to be able to modify this program.
It is legal to only possess the executable-code, but not to distribute only
the executable. It is legal to distribute only the source code. For more
information on the license, see the textfile also distributed with this
archive.
Files in the Mod2Midi package:
Mod2Midi Executable
Mod2Midi.ins Instrument file
Mod2Midi.map Info file
Mod2Midi.doc Documentation
Mod2Midi.c Source code
Mod2Midi.h Source code
Select.c Source code
Text.h Source code
makefile Source code
midimod2.zip Original PC archive
How to get in touch
===================
You can contact the original author, Andrew Scott at the following
address:
ascott@tartarus.uwa.edu.au
Andrew Scott
55 McCabe Street
Mosman Park
Western Australia 6012
You can contact the author of the Amiga conversion, Paul Huxham at the
following address:
paulh@Perth.DIALix.oz.au
PO Box 875
Morley
Perth
Western Australia 6943